#pragma once

#include <Ogre.h>
#include "BtOgrePG.h"
#include "BtOgreGP.h"
#include "BtOgreExtras.h"
#include "BaseCannon.h"

using namespace Ogre;

class BaseMissile
{
public:
	BaseMissile(Ogre::SceneManager* sceneMgr);
	~BaseMissile(void);

	void rotateLeft();
	void rotateRight();

	void tickCallBack();
	void updateMissile(double timeSinceLastFrame);
	void updateTarget(Ogre::Vector3 target);
	void changeDebugVisibility();
	
	bool getActiveState();
	void setActiveState(bool state);
	void resetMissile(Ogre::Vector3 pPos, Ogre::Quaternion pOrientation, Vector3 target);

	Ogre::Timer*					aliveTimer;
	long						aliveTimerMax;

private:
	btRigidBody					*m_MissileBody;
	Ogre::SceneNode*			m_MissileNode;

	Ogre::Entity*				m_MissileEntity;
	Ogre::Vector3				m_TranslateVector;
	Ogre::Vector3				m_RotateVector;
	Ogre::Real					m_MoveSpeed;
	Ogre::Real					m_RotateSpeed;
	float						m_MoveScale;
	float						m_RotScale;

	Ogre::SceneManager*			m_pSceneMgr;

    btCollisionShape			*m_MissileShape;
	BtOgre::RigidBodyState *	m_MissileState;
	int							m_MaxSpeed;
	int							m_MaxRotateSpeed;
	bool						isActive;
	Ogre::Vector3				m_MissileTarget;

};

